// components/compare/compare.js
Page({
	
	/**
	 * 页面的初始数据
	 */
	data: {
		a: '', b: '', res: ""
	},
	changeA: function (change) {
		this.setData({a: change.detail.value});
	},
	changeB: function (change) {
		this.setData({b: change.detail.value});
	},
	compare: function () {
		let a = Number(this.data.a);
		let b = Number(this.data.b);
		let res = a && b ? (a === b ? '一样大' : '第' + (a > b ? '一' : '二') + '个大') : "请输入正确值";
		this.setData({
			res: res
		});
	}
})